import base64
from typing import List

import shortuuid
from peewee import JOIN

from afast_core.core_libs.captcha.cilent import generate_captcha
from afast_core.core_tools.jwt_helper import SimpleAuth
from infirmary_admin_src.infirmary_common.infirmary_controller import IAsyncSessionBaseController, IBaseController
from infirmary_admin_src.infirmary_common.infirmary_controller.rest_controller_with_depends import \
    RestControllerWithDepends
from fastapi import Request, Depends, Path, Body
from afast_core.core_tools import json_helper
from infirmary_admin_src.infirmary_smart_admin.infirmary_biz.support.services import SupportBusinesses





class IController(IBaseController):
    '''
    定制相关约束检测函数逻辑步序
    '''

    def __init__(self, *, request: Request,
                 ids: List[int],
                 ):
        super().__init__(request=request)
        # 入参参数
        # 入参参数
        self.ids = ids


@RestControllerWithDepends()
class SupportDictKeyDeleteController(IController):

    def business_login(self):
        pass
        result = SupportBusinesses.edit_dict_key_batch(ids=self.ids, deleted_flag=1)
        if result:
            self.response_msg = '删除成功'
        else:
            self.response_ok = False
            self.response_msg = '删除失败'
            return None
